import React from 'react'
import {Route,Link} from 'react-router-dom'
import Children from './Children'
class Parent extends React.Component{
    pay(){
        this.props.history.push('/parent/children')
    }
    render(){
        return(
            <div>
            <div>this is parent</div>
            {/* 两种改变url进行跳转的方式 */}
            {/* <div><Link to="/parent/children">跳转children</Link></div> */}
            <div><Link to={`${this.props.match.url}/children`}>跳转children</Link></div>
            <div><Link onClick={e=>this.pay()}>跳转children</Link></div>

            <Route path='/parent/children' component={Children}></Route>
            </div>
        )
    }
}
export default Parent